package com.yswy.backstage.dto.req;

import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

import javax.validation.constraints.NotEmpty;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Pattern;
import java.util.Date;
import java.util.List;

/**
 * @author 19401
 * @date 2022/6/6 17:09
 **/
@Data
public class UserOptionReqVO extends GroupsReqVO {
    @NotNull(message = "ID不能为空", groups = UPDATE.class)
    private Integer id;

    @ApiModelProperty("用户 名称")
    @NotEmpty(message = "用户 名称 不能为空", groups = {CREATE.class, UPDATE.class})
    private String userName;
    @ApiModelProperty("用户 密码")
    @Pattern(regexp = "[a-zA-Z0-9]{6,20}", message = "密码格式错误，请输入6-20位数字或大小写字母")
    @NotEmpty(message = "用户 密码 不能为空", groups = {CREATE.class, UPDATE.class})
    private String pwd;
    @ApiModelProperty("用户 电话")
    @NotEmpty(message = "用户 电话 不能为空", groups = {CREATE.class, UPDATE.class})
    @Pattern(regexp = "\\d{0,11}", message = "请输入有效的手机号码")
    private String userPhone;
    @ApiModelProperty("过期时间")
    @NotNull(message = "过期时间 不能为空", groups = {CREATE.class, UPDATE.class})
    private Date expireTime;
    @ApiModelProperty("性别")
    private Integer sex;

    @ApiModelProperty("角色Ids")
    private List<Integer> roleIds;
}
